package fingerGussingGame2;

public class Computer extends Player
{
	public Computer(String name )
	{
		super(name);
	}

	/**
	 * 电脑出拳，不用输入
	 */
	@Override
	public Option showFirst()
	{
		// 生成0,1,2随机数
		Option opt=null;
		int num = (int) (Math.random() * 3 + 1);
		if (num == Option.SCISSORS.getValue())
		{
			opt=Option.SCISSORS;
		} else if (num == Option.ROCK.getValue())
		{
			opt=Option.ROCK;
		} else
		{
			opt=Option.PAPER;
		}
		System.out.println(getName()+"出："+ opt.getNameString());
		return opt;
	}

}
